home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -websites- / wirenet / files / thor25_arexx.lha / Examples / GetFileList_ex.thor < prev    next >
Text File  |  1995-09-06  |  782b  |  38 lines

  1. /*
  2. **
  3. ** GetFileList_Ex.thor  - Example script for the GETFILELIST function in THOR 2.0
  4. **
  5. */
  6.  
  7. options results
  8.  
  9. if(substr(address(),1,4) ~= "THOR") then do
  10.     parse arg thorport
  11.     if~(show(p, thorport)) then do
  12.         if ~(show(p, "THOR.01")) then do
  13.             say "No THOR port found!"
  14.             exit
  15.         end
  16.         else thorport = "THOR.01"
  17.     end
  18. end
  19. else thorport = address()
  20.  
  21. address(thorport)
  22.  
  23. GETFILELIST outstem LIST
  24. if(rc ~= 0) then
  25. do
  26.     if(rc = 5) then REQUESTNOTIFY TEXT '"Filedatabase window not open."' BT '"_Ok"'
  27.     if(rc = 6) then REQUESTNOTIFY TEXT '"No files selected."' BT '"_Ok"'
  28.     if(rc = 30) then REQUESTNOTIFY TEXT '"'THOR.LASTERROR'"' BT '"_Ok"'
  29.     exit
  30. end
  31.  
  32. say 'You selected '||LIST.COUNT||' files'
  33. do i=1 to LIST.COUNT
  34.     say 'Nr:' || LIST.FILENR.i || ' Filename: ' || LIST.FILENAME.i
  35. end
  36.  
  37. exit
  38.